#ifndef _H_IN_
#define _H_IN_

#ifdef __cplusplus
extern "C" {
#endif

#include "carmela_util.h"
#include "carmela_sdk.h"
#include "carmela_broker.h"
#include "benchmark.h"

struct MQTool
{
	struct TcpdaemonEntryParameter	entry ;
	
	char				*action ;
	char				*show ;
	uint32_t			delay_seconds ;
	char				*store_name ;
	char				*topic_name ;
	char				*tags ;
	char				*subscribe_group_name ;
	uint32_t			msg_data_len ;
	char				*msg_data ;
	char				*msg_data_prefix ;
	size_t				process_count ;
	size_t				batch_count ;
	char				*file ;
	uint64_t			msg_offset ;
	uint64_t			topic_offset ;
	uint64_t			delay_msg_offset ;
} ;

int app( struct MQTool *tool );

int app_CreateStore( struct MQTool *tool );
int app_DestroyStore( struct MQTool *tool );

int app_CreateTopic( struct MQTool *tool );
int app_DestroyTopic( struct MQTool *tool );

int app_ProduceMessage( struct MQTool *tool );
int app_ConsumeMessage( struct MQTool *tool );

int app_ProduceMessages( struct MQTool *tool );
int app_ConsumeMessages( struct MQTool *tool );

int app_ProduceDelayMessage( struct MQTool *tool );
int app_CancelDelayMessage( struct MQTool *tool );

int app_ParseMessageFile( struct MQTool *tool );
int app_ParseTopicFile( struct MQTool *tool );
int app_ParseDelayMessageFile( struct MQTool *tool );

#ifdef __cplusplus
}
#endif

#endif

